package cn.tedu.mycoolshark.map;

import cn.tedu.mycoolshark.entity.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper {
    @Insert("insert into product values(null,#{title},#{url},#{price}," +
            "#{oldPrice},#{saleCount},#{num},0,"+
            "#{created},#{categoryId})")
    void insert(Product product);
    @Select("select id,title,url,price,old_price,sale_count from product")
    List<Product> selectIndex();
}
